package com.cn.dao;
/**
 * 门店dao层
 * 
 */
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import com.cn.conn.DataManager;
import com.cn.conn.ParamSet;
import com.cn.conn.RowDatas;
import com.cn.entity.Store_entity;

public class Dz_mendianDao extends DataManager {
		private RowDatas<Store_entity> store;
		public Dz_mendianDao(){
			store = new stores();
		}
		
		public List<Store_entity>  getStore(String address){
			String sql= "SELECT a.id ,a.store_name FROM tb_store a "
							   + " WHERE a.store_address = ?";
			return  queryList(sql, new ParamSet(address), store);
		}
		
		private class stores implements RowDatas<Store_entity>{

			@Override
			public Store_entity getRowData(ResultSet rs) throws SQLException {
				Store_entity st = new Store_entity();
				st.setStore_name(rs.getString("store_name"));
				st.setId(rs.getString("id"));
				return st;
			}
			
		}

}
